<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var r1 = function (config) {
            console.log('r1', config);
            return config;
        }

        var r2 = function (config) {
            console.log('r2', config);
            config.message = 'hello word'
            return Promise.reject('1111')
            return config
        }

        var p = Promise.resolve({ name: 111, age: 20}).then(r1).then(r2)
        const p2 = p.then(d => {
            console.log(d)
            return d;
        }).catch(err => {
            return Promise.resolve('1111')
        })

        p2.then(d => {
            console.log(d)
        })
    </script>
</body>
</html>
